package com.atguigu.boot.acrivemq.consumer;

import org.springframework.jms.JmsException;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @Auther 赵乾坤
 * @Date 2021-04-17 14:47
 */
@Component
public class Queue_Consumer {

    @JmsListener(destination = "${myqueue}")//监听配置文件的 目的地
    public void receive(TextMessage textMessage) throws  JMSException {
        System.out.println("*******消费者收到消息：" + textMessage.getText());
    }
}
